import request from '@/utils/request'
import type { WalletResult, PayQrcodeData, PayQrcodeResult } from './types'


/** 钱包路由所有操作接口 */
class APIWallet {
    /** 获取钱包金额 */
    static getWallet() {
        return request<any, ResponseData<WalletResult>>({
            url: '/getWallet',
            method: 'POST'
        })
    }

    /** 生成支付二维码 */
    static payQrcode(data: PayQrcodeData) {
        return request<any, ResponseData<PayQrcodeResult>>({
            url: '/pay/qrcode',
            method: 'POST',
            data
        })
    }

    /** 充值金额列表获取 */
    static getFinanceRecharge() {
        return request<any, ResponseData>({
            url: '/getFinanceRecharge',
            method: 'POST'
        })
    }

    static getPayList(params: any) {
        return request<any, ResponseData>({
            url: '/getPayList',
            method: 'POST',
            params
        })
    }

    static getRechargelist(params: any) {
        return request<any, ResponseData>({
            url: '/getRechargelist',
            method: 'POST',
            params
        })
    }

    static getAllRechargelist(params: any) {
        return request<any, ResponseData>({
            url: '/getAllRechargelist',
            method: 'POST',
            params
        })
    }

    static setInvoice(data: any) {
        return request<any, ResponseData>({
            url: '/setInvoice',
            method: 'POST',
            data
        })
    }

    static getInvoiceList(params: any) {
        return request<any, ResponseData>({
            url: '/getInvoiceList',
            method: 'POST',
            params
        })
    }
    static getInvoiceDeail(id: any) {
        return request<any, ResponseData>({
            url: '/getInvoiceDeail',
            method: 'POST',
            data: { id }
        })
    }

    
}

export default APIWallet
